﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using RSHB.Frontend.UI;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Portal.Frontend.UI.ViewModels;

namespace RSHB.Frontend.UI.ViewModels
{
    public abstract class LoanAgreementEditViewModel : SharedRSHBViewModel
    {
        public int LoanAgreementID { get; set; }
        [DisplayName("Заголовок")]
        [Required()]
        public string LoanAgreementTitle { get; set; }

        [DisplayName("Номер")]
        [Required()]
        public string LoanAgreementNum { get; set; }

        [DisplayName("Ткущий счет заемщика")]
        [Required]
        public string LoanAgreementAccount { get; set; }

        [DisplayName("Сумма")]
        [Required()]
        public decimal LoanAgreementAmount { get; set; }

        [DisplayName("Процентная ставка")]
        [Required()]
        public decimal LoanAgreementRate { get; set; }

        [DisplayName("Полная процентная ставка")]
        [Required()]
        public decimal LoanAgreementFullRate { get; set; }

        [DisplayName("Дата выдачи кредита")]
        [DisplayFormat(DataFormatString = "{0:d}")]
        [DataType(DataType.Date)]
        public DateTime LoanAgreementIssueDate { get; set; }

        [DisplayName("Дата возврата кредита")]
        [DisplayFormat(DataFormatString = "dd.MM.yyyy")]
        public DateTime LoanAgreementRepaymentDate { get; set; }

        [DisplayName("№ Договора поручительства физического лица")]
        [Required]
        public string LoanAgreementContractOfGuaranteeNum { get; set; }

        [DisplayName("Дата договора поручительства физического лица")]
        [Required]
        public DateTime LoanAgreementContractOfGuaranteeDate { get; set; }

        [DisplayName("Заемщик")]
        public IEnumerable<SelectListItem> Borrowers { get; set; }
        [Required()]
        [Range(1, 10000)]
        public int SelectedBorrowerID { get; set; }

        [DisplayName("Созаемщик")]
        public IEnumerable<SelectListItem> CoBorrowers { get; set; }
        public int? SelectedCoBorrowerID { get; set; }

        [DisplayName("Поручитель 1")]
        public IEnumerable<SelectListItem> Sponsors1 { get; set; }
        public int? SelectedSponsor1ID { get; set; }

        [DisplayName("Поручитель 2")]
        public IEnumerable<SelectListItem> Sponsors2 { get; set; }
        public int? SelectedSponsor2ID { get; set; }
    }
}